#include <stdio.h>
#include <stdlib.h>

#define Item int
typedef struct
{
    Item item;
    int next;
} Node;

typedef struct 
{
    int length;
    int current;
    Node *nodes;
} SimulationSpace;

SimulationSpace * CreateSimulationSpace(int length)
{
    //SimulationSpace *space = (SimulationSpace *)malloc(sizeof(SimulationSpace *));
     SimulationSpace *space = (SimulationSpace *)malloc(sizeof *space);
    space->length = length;
    space->nodes = (Node *)malloc(length * sizeof(Node *));
    for (size_t i = 0; i < length - 1; i++)
    {
        space->nodes[i].next = i + 1;
    }

    space->nodes[length - 1].next = -1;
    space->current = 0;

    return space;
} 

int main(int argc, char const *argv[])
{

    return 0;
}
